<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>好家伙零食商城订单</title>
<base href="../">
<meta name="keywords" content="小吃,美食,零食,源辰" />
<meta name="description" content="各种小吃美食，应有尽有" />
<link href="images/yc.png" rel="shortcut icon" type="image/x-icon" />
<link href="css/header.css" rel="stylesheet" type="text/css" />
<link href="css/order.css" rel="stylesheet" type="text/css" />
<link href="css/footer.css" rel="stylesheet" type="text/css" />
</head>

<body>
<!-- 顶部区域 -->
<header id="header">
	<!-- 顶部标题区域 -->
	<div class="htitle">
    	<a href="#" target="_blank" class="location">衡阳</a>
        
        <div class="header-info" id = "login_info">
            <div class="login-info" v-if="onlogin">
            	<a href="login.html" title="点击登录" target="_blank">欢迎您：{{nickName}}</a>
                <a href="register.html" title="点击注册"> 免费注册 </a>
            </div>
             <div class="login-info" v-else>
            	<a href="login.html" title="点击登录" >您好，请登录</a>
                <a href="register.html" title="点击注册"> 免费注册 </a>
            </div>
            
            <div class="person-info">
            	<span>|</span>
            	<a href="front/order.html" target="_blank">我的订单</a>
                <span>|</span>
                <a href="#" target="_blank">我的小吃</a>
                <span>|</span>
                <a href="#" target="_blank">客户服务</a>
                <span>|</span>
           		<a href="#" target="_blank">个人信息</a>
            </div>
        
        </div>
    </div>
    
    <!-- 顶部搜索区域 -->
    <div class="search">
    	<div class="search_left">
    		<a href="index.html" title="首页">
            	<img src="images/logo.png" width="260px" height="120px"/> 
            </a>
        </div>
        
        <div class="search_right" id = "search_item">
        	<div class="search_top">
                <div class="search_div">
                    <input type="search" class="search-ipt" placeholder="请输入要搜索的内容" />
                    <input type="button" class="search-btn"/>  
                </div>
                <div class="buycart">
                	<i class="iconfont" >{{cartCount}}</i>
                    <a href="front/cart.html" target="_blank">我的购物车</a>
                </div>
            </div>
            
            <div class="search_item" id="search_item">
				<a href="javascript:void(0)" data-tno="" class="selected" @click="findByTno(0,'')">全部</a> 
				<a v-for="(type,index) in types" :data-tno="type.tno" href="javascript:void(0)" @click="findByTno(index+1,type.tno)">{{type.tname}}</a>
			</div>
        </div>
    </div>
</header>
     
<!-- 订单列表 -->
<div class="common_list_con clearfix" id="order_list">
    <ul class="goods_list_th clearfix">
        <li class="col01">商品名称</li>
        <li class="col03">商品单位</li>
        <li class="col03">商品价格</li>
        <li class="col02">数量</li>
        <li class="col03">小计</li>		
    </ul>
</div>
<div class="order_list_con" id="products_list">
 <div v-for="item in orders">
    <div class="order_title">
    	<span>订单号：{{item.ono}}</span><span>下单日期： {{item.odate}}</span><span>订单总额：<b style="color:red">{{item.totalPrice}}</b> 元</span>
    	<a href="javascript:void(0)" v-if="item.status == 1" @click="gotoPay(item.ono,item.totalPrice)" style="color:red">去支付</a>
    	<a href="javascript:void(0)" v-else-if="item.status == 2"  style="color:orange">已支付</a>
    	<a href="javascript:void(0)" v-else-if="item.status == 3"  style="color:purple">已发货</a>
    	<a href="javascript:void(0)" v-else-if="item.status == 4"  >去评论</a>
    	<a href="javascript:void(0)" style="color:green" v-else  >已完成</a>
    </div>
    <ul class="goods_list_td clearfix" v-for="(itm,index) in item.goods">
        <li class="col01">{{index+1}}</li>			
        <li class="col02"><img :src="itm.pics"></li>
        <li class="col03">{{itm.gname}}</li>
        <li class="col04">{{itm.weight}}/{{itm.unit}}</li>
        <li class="col04">{{itm.price}}元</li>
        <li class="col03">{{itm.nums}}</li>
        <li class="col04" v-html="(itm.nums * itm.price).toFixed(2)+'元'"></li>	
    </ul>
 </div>
</div>      
<footer>
	<div class="foot_link">
        <a href="#">关于我们</a> <span> | </span>
        <a href="#">联系我们</a> <span> | </span>
        <a href="#">招聘广告</a> <span> | </span>
        <a href="#">友情链接</a>
    </div>
    <p>CopyRight &copy; 2019 <a class="copy" href="http://www.hyycinfo.com" target="_blank">衡阳市源辰信息科技有限公司</a> All Rights Reserverd</p>
    <p>电话：0734-8355998 湘ICP备16015987号-1</p>
</footer>
<script src="js/jquery-3.4.1.min.js"></script>
<script src="js/vue.js" type="text/javascript"></script>
<script src="js/axios.js" type="text/javascript"></script>
<script src="js/qs.js" type="text/javascript"></script>
<script src="js/checklogin.js" type="text/javascript"></script>
<script src="js/getcartinfo.js" type="text/javascript"></script>
<script type="text/javascript">

let app = new Vue({
	el:"#products_list",
	data:{
		orders:[]
	},
	mounted:function(){
		axios.get("order/finds").then(result=>{
			if(result.status == 200 && result.data.code == 200){
				this.orders = result.data.data;
			}
		})
	},
	methods:{
		gotoPay:function(ono,price){
			location.href = 'order/alipay/pay/'+ ono+ "/" + price;
		}
	}
})

</script>
</body>
</html>
